package com.cardone.platform.authority.service;

import java.util.List;

import lombok.Getter;
import lombok.Setter;

import com.cardone.common.dto.PaginationDto;
import com.cardone.context.ContextHolder;
import com.cardone.platform.authority.dao.UsGroupRoleDao;
import com.cardone.platform.authority.dto.UsGroupRoleDto;

/**
 * 用户组与角色服务
 *
 * @author yaohaitao
 *
 */
@Getter
@Setter
public class UsGroupRoleDefaultService implements UsGroupRoleService {
	@Override
	public int deleteByIds(final UsGroupRoleDto deleteUsGroupRole) {
		return ContextHolder.getBean(UsGroupRoleDao.class).deleteByIds(deleteUsGroupRole);
	}

	@Override
	public <P> P findByCodeOrId(final Class<P> mappedClass, final UsGroupRoleDto findUsGroupRole) {
		return ContextHolder.getBean(UsGroupRoleDao.class).findByCodeOrId(mappedClass, findUsGroupRole);
	}

	@Override
	public <P> P findById(final Class<P> mappedClass, final UsGroupRoleDto findUsGroupRole) {
		return ContextHolder.getBean(UsGroupRoleDao.class).findById(mappedClass, findUsGroupRole);
	}

	@Override
	public <P> List<P> findListByLikeCode(final Class<P> mappedClass, final UsGroupRoleDto findListUsGroupRole) {
		return ContextHolder.getBean(UsGroupRoleDao.class).findListByLikeCode(mappedClass, findListUsGroupRole);
	}

	@Override
	public int insertByCode(final UsGroupRoleDto insertUsGroupRole) {
		return ContextHolder.getBean(UsGroupRoleDao.class).insertByCode(insertUsGroupRole);
	}

	@Override
	public <P> PaginationDto<P> paginationByLikeCode(final Class<P> mappedClass, final UsGroupRoleDto paginationUsGroupRole) {
		return ContextHolder.getBean(UsGroupRoleDao.class).paginationByLikeCode(mappedClass, paginationUsGroupRole);
	}

	@Override
	public Integer readByCodeNqIdForCount(final UsGroupRoleDto readUsGroupRole) {
		return ContextHolder.getBean(UsGroupRoleDao.class).readByCodeNqIdForCount(readUsGroupRole);
	}

	@Override
	public <P> P saveByIdOrCode(final Class<P> mappedClass, final UsGroupRoleDto saveUsGroupRole) {
		return ContextHolder.getBean(UsGroupRoleDao.class).saveByIdOrCode(mappedClass, saveUsGroupRole);
	}

	@Override
	public int updateByCode(final UsGroupRoleDto updateUsGroupRole) {
		return ContextHolder.getBean(UsGroupRoleDao.class).updateByCode(updateUsGroupRole);
	}
}